package com.cxso.example.client;

import com.cxso.example.enums.ProductClientEnum;
import com.cxso.example.request.insure.InsureOrderRequest;
import com.cxso.example.sdk.domain.Result;
import com.cxso.example.sdk.http.base.HttpMethod;
import com.cxso.example.sdk.http.client.Client;
import com.cxso.example.sdk.http.core.ChoiceClient;
import io.swagger.v3.oas.annotations.media.Schema;

@Schema(description = "保险服务")
public class InsureClient extends Client {

    public InsureClient(ChoiceClient choiceClient) {
        super(choiceClient);
    }

    @Schema(description = "物流保险下单")
    public Result<?> order(InsureOrderRequest req) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/insure/operateOrder", HttpMethod.POST, req).toResult();
    }
}
